﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="tvStationList.aspx.cs" Inherits="Com.CMS263.Web.manage.TvStation.tvStationList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
     <link href="../style/main.css" rel="stylesheet" type="text/css" />
    <link href="../common/validator.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="/js/jquery-1.4.2.min.js"></script>

    <script language="javascript" type="text/javascript">
        var npage = 0;
        function checkPageNum(obj, obj2) {
            var num = $("#pagetext").val();
            var p = /^[1-9]\d*$/;

            if (num.length < 1) {
                alert("请输入要跳转的页码");

            }
            else if (!p.exec(num)) {
                $("#pagetext").attr("value", 1);
                alert("要跳转的页码请输入正整数");
            }
            else if (num > obj) {
                $("#pagetext").attr("value", obj);
                npage = obj;

            }
            else if (num < 1) {
                $("#pagetext").attr("value", 1);
                npage = 1;

            }
            else {

            }

        }
        function pageUrl(obj) {

            window.location.href = '?page=' + $("#pagetext").val() + "&type=" + obj;
        }
    </script>

    <script language="javascript" type="text/javascript">
        function del(id, obj) {
            if (confirm('这是一个不可逆的操作，真的要删除此条记录')) {
                $.post("Station_action.aspx?op=deleteStation&&id="+id, {}, function(data) {
                    if (data == "ok") {
                        alert('删除成功');
                        $(obj.parentNode.parentNode).remove();
                    }
                })
            }
        }
    </script>
</head>
<body>
<form id="form1" runat="server">
    <div>
        <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_1">
            <tr>
                <td height="23" class="table_2">
                    <asp:Label ID="lbTypeName" runat="server"></asp:Label>
                    管理
                </td>
            </tr>
            <tr>
                <td class="tdside" align="left">
                    <a href="addTvStation.aspx">添加新内容</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    搜索:<asp:TextBox ID="txtKey" runat="server"></asp:TextBox>
                    <asp:Button ID="Button1" runat="server" Text="搜索"  />
                    <br />
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%">
                        <tr style="text-align: center">
                            <td>
                                排序编号
                            </td>
                            <td>
                                名称
                            </td> 
                            <td>
                                logo图(154*76)
                            </td>
                              <td>
                               电话
                            </td>
                              <td>
                                地址
                            </td>
                            <td>
                                操作
                            </td>
                        </tr>
                        <% foreach(Com.CMS263.PO.TVstation tv in tvList)
                           { %>
                        <tr style="background-color: #d7f2fd; text-align: center">
                            <td>
                                <%=tv.Id%>
                            </td>
                            <td>
                                <a title="<%=tv.Name%>">
                                    <%=Com.CMS263.Util.StringUtil.GetText(tv.Name,15) %></a>
                            </td>                          
                             <td>
                                <img src="/ArtUpFile/<%=tv.LogoPic %>"  width="100px;" height="100px;"/>
                            </td>
                              <td>
                                <%=tv.TelePhone %>
                            </td>
                              <td>
                                <%=tv.Address %>
                            </td>
                            <td>
                                <a href="editTvStation.aspx?page=<%=pageTv %>&&id=<%=tv.Id%>">
                                    修改</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a style="cursor: pointer" onclick="del(<%=tv.Id%>,this)">
                                        删除</a>
                            </td>
                        </tr>
                        <%} %>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="tdside" align="right">
                    <%=GetPagerTv()%>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
